/**
 * 
 */
package anyware.desktop.support;

import org.apache.lucene.store.FSDirectory;
import org.springframework.beans.factory.config.AbstractFactoryBean;

/**
 * @author keke
 * 
 */
public class FSDirectoryFactoryBean extends AbstractFactoryBean {
    private String filePath;

    /*
     * (non-Javadoc)
     * 
     * @see org.springframework.beans.factory.config.AbstractFactoryBean#getObjectType()
     */
    @Override
    public Class<?> getObjectType() {
        return FSDirectory.class;
    }

    public void setFilePath(final String filePath) {
        this.filePath = filePath;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.springframework.beans.factory.config.AbstractFactoryBean#createInstance()
     */
    @Override
    protected Object createInstance() throws Exception {
        return FSDirectory.getDirectory(filePath);
    }

}
